
import { ADD_VALUE } from '../actions/ttyactions'
import { counterStateType } from './types';


export default function reducer(state: counterStateType['tty'] = { value: '' }, action: { type: string, data: Buffer }) {
    switch (action.type) {
        case ADD_VALUE:
            const value = state.value + action.data.toString()

            return {
                value: value.substring(value.length - 10000)
            }
        default:
            return state;
    }
}

